package com.applcn.shop.client;

import com.applcn.core.base.Result;
import com.applcn.shop.ShopConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * com.applcn.shop.client
 * Description:
 *
 * @author: 大妖怪
 * @date: 2020-02-22 17:49
 */
@FeignClient(name = ShopConstant.SERVICE_NAME, url = "${applcn.shop-service-endpoint}", path = "/feign/shop")
public interface ShopClient {

    /**
     * 通过id列表查询店铺
     *
     * @param ids
     * @return
     */
    @GetMapping("/listShopByIds")
    Result listShopByIds(@RequestParam("ids") List<Long> ids);

    /**
     * 查询店铺绑定商户
     *
     * @param shopId
     * @return
     */
    @GetMapping("/listMerchantByShopId")
    Result listMerchantByShopId(@RequestParam("shopId") Long shopId);

    /**
     * 店铺绑定商户
     *
     * @param shopId
     * @param merchantIds
     * @return
     */
    @PostMapping("/bindMerchants")
    Result bindMerchants(@RequestParam("shopId") Long shopId, @RequestParam("merchantIds") List<Long> merchantIds);
}
